$('#product-list').append('<%= escape_javascript(render :partial => 'product_list', :locals => { :products => @products }) %>');
<% if @products.next_page %>
  $('.pagination').replaceWith('<%= j will_paginate @products %>');
<% else %>
  $(window).off('scroll');
  $('.pagination').remove();
<% end %>